<html>
<meta charset="UTF-8">
<link rel="shortcut icon" href="https://csser.top/bilibili/favicon.png" />
<meta name="viewport"
  content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<style>
  * {
    padding: 0;
    margin: 0;
  }

  p {
    word-break: break-all;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.2;
  }

  .donate {
    margin-top: 8px;
  }

  .donate img {
    width: 100%;
  }

  .dark {
    color: #ccc;
  }

  .dark a,
  .dark a:visited,
  .dark a:hover {
    color: rgb(97, 177, 213);
  }

  .high-light {
    color: red;
  }

  .dark .high-light {
    color: orange;
  }
</style>

<div id="content">
  <p>
    <strong class="high-light">注意</strong>：
    <br /><br />
    <strong class="high-light">收到B站<a href="https://csser.top/bilibili/img/bilibili_lshh.jpg"
        target="_blank">律师函</a>了，近期将会从各商店下架，已经安装的大家应该是可以继续使用的吧</strong>
    <br /><br />
    目前暂不支持“稍后再看”和“收藏夹”播单，请到单独的视频播放页使用，电影类的视频一部分支持
    <br /><br />
    高级模式下载失败请尝试兼容模式
    <br /><br />
    遇到问题请先看<a href="https://docs.qq.com/doc/DQ2lhaWRpS0tubVVF" target="_blank">使用教程和常见问题解答</a>
    <br /><br />
    <!-- 作者邮箱：indooorsman@gmail.com
    <br/><br/> -->
  </p>
  <p id="versions">
    <strong class="high-light">最新版本</strong>：
    <span id="latestVersion"> </span> 已安装版本：<span id="currentVersion">未知</span>
  </p>
  <p id="updateNotice">
    请到扩展商店更新，或下载<a id="crxLink" target="_blank">crx文件</a>或<a id="zipLink"
      target="_blank">zip文件</a>后手动安装，请自行搜索“如何手动安装Chrome扩展”
  </p>
  <div class="donate">
    <p>微信扫一扫赞赏作者(扫不出来请点击图片后扫大图)：</p>
    <a href="https://csser.top/bilibili/img/zanshang.webp" target="_blank">
      <img title="点击查看大图" alt="点击查看大图" id="zanshang" src="https://csser.top/bilibili/img/zanshang.webp" />
    </a>
  </div>
</div>

<script>
  (() => {
    const latest = { name: '3.0.2', code: 302 };
    const currentVersionSpan = document.getElementById('currentVersion');
    const latestVersionSpan = document.getElementById('latestVersion');
    const crxLink = document.getElementById('crxLink');
    const zipLink = document.getElementById('zipLink');

    latestVersionSpan.textContent = latest.name;
    crxLink.href = `http://csser.top`;
    zipLink.href = `http://csser.top`;

    window.addEventListener('message', evt => {
      evt.data && evt.data.action === 'getHeight' && evt.source.postMessage({
        action: 'reportHeight',
        height: document.getElementById('content').offsetHeight
      }, evt.origin);

      evt.data && evt.data.action === 'setTheme' && document.querySelector('html').classList.add(evt.data.theme);

      evt.data && evt.data.action === 'setVersion' && (() => {
        const versionName = evt.data.version.name;
        const versionCode = evt.data.version.code;

        currentVersionSpan.textContent = versionName;

        if (latest.code <= versionCode) {
          document.getElementById('updateNotice').style.display = 'none';
        } else {
          document.getElementById('updateNotice').style.display = 'block';
          evt.source.postMessage({
            action: 'showBilibilihelperindooorsmanNoticeDialog',
            notices: [
              {
                id: `upgrade_notice_${latest.code}`,
                title: `【有新版(${latest.name})，请更新】`,
                content: `已安装版本 ${versionName}，最新版本 ${latest.name}，<a href="http://csser.top/bilibili/changelog/?v=${latest.code}" style="color:rgb(58, 117, 215)" target="_blank">更新日志&raquo;</a><br>
                  安装最新版：<a style="color:rgb(58, 117, 215)" href="https://chrome.google.com/webstore/detail/bfcbfobhcjbkilcbehlnlchiinokiijp" target="_blank">Chrome商店</a>&nbsp;&nbsp;<a href="http://csser.top/bilibili/bilibili-helper-${latest.name}.crx" style="color:rgb(58, 117, 215)" target="_blank">crx文件</a>`
              }
            ]
          }, evt.origin);
        }
        evt.source.postMessage({
          action: 'reportHeight',
          height: document.getElementById('content').offsetHeight
        }, evt.origin);
      })();
    }, false);
  })();
</script>

</html>